import service from "@/utils/request";
import type { Response, PageResponse, CodeName, ListResponse } from "@/types/common";
import type { TimezoneItem } from "@/types/access/timezone";
export const useAccessTimezonePageApi = (params: object) => {
  return service<any, Response<PageResponse<TimezoneItem>>>({
    url: `/v1/access/timezone/page`,
    method: "GET",
    params,
  });
};

export const useAccessTimezoneQueryApi = (params: object) => {
  return service<any, Response<TimezoneItem>>({
    url: `/v1/access/timezone/query`,
    method: "GET",
    params,
  });
};

export const useAccessTimezoneListApi = () => {
  return service<any, ListResponse<CodeName>>({
    url: `/v1/access/timezone/list`,
    method: "GET",
  });
};

export const useAccessTimezoneCreateApi = (data: object) => {
  return service({
    url: `/v1/access/timezone/create`,
    method: "POST",
    data,
  });
};

export const useAccessTimezoneUpdateApi = (data: object) => {
  return service({
    url: `/v1/access/timezone/update`,
    method: "POST",
    data,
  });
};

export const useAccessTimezoneDeleteApi = (data: object) => {
  return service({
    url: `/v1/access/timezone/delete`,
    method: "DELETE",
    data,
  });
};
